package org.shx.springboot.ollama.ai.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*设置额外的静态资源目录，默认有一个static 直接访问 localhost:8080/index.html */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 假设index.html在src/main/resources/my-html目录下
        registry.addResourceHandler("/myhtml/**")
                .addResourceLocations("classpath:/my-html/");
    }
}